package com.itheima.demo02;

import java.util.TreeSet;

public class MainClass01 {
    public static void main(String[] args) {
        TreeSet<Student> ts = new TreeSet<>();
        Student s4 = new Student("qianliu" ,26);
        Student s3 = new Student("wangwu" ,25);
        Student s2 = new Student("wuzun" ,25);
        Student s1 = new Student("zhangsan" ,23);
        ts.add(s1);
        ts.add(s2);
        ts.add(s3);
        ts.add(s4);
        for (Student student : ts) {
            System.out.println(student);
        }
    }
}
